# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo5.04
# Description:
# Author:       98745
# Date:         2019/2/26
#-------------------------------------------------------------------------------

from string import Template
template=Template('$s是我最喜欢的编程语言，$s非常容易学习，而且功能强大')
print(template.substitute(s='python'))
template2=Template('${s}stitute')
print(template2.substitute(s='sub'))
template3=Template('$dollar$$相当于多少$pounds')
print(template3.substitute(dollar=20,pounds='英镑'))
template4=Template('$dollar$$相当于多少$pounds')
data={}
data['dollar']=100
data['pounds']='英镑'
print(template4.substitute(data))